package io.github.lee.jel.repository

import io.github.lee.jel.api.ApiModule
import io.github.lee.jel.domain.Item
import io.github.lee.jel.domain.Page
import io.github.lee.jel.domain.Response
import javax.inject.Inject

class PlayListRepository @Inject constructor() : BaseRepository() {

    suspend fun playingList(
        userId: String?,
        startIndex: Int? = null,
        limit: Int? = 20,
        searchTerm: String? = null,
        fields: List<String>? = null,
        mediaTypes: List<String>? = null,
    ): Response<Page<Item>> =
        ApiModule.playListApi()
            .playingList(userId ?: "", startIndex, limit, searchTerm, fields, mediaTypes)


    suspend fun latest(
        userId: String?,
        parentId: String?,
        startIndex: Int? = null,
        limit: Int? = 20,
    ): Response<List<Item>> =
        ApiModule.playListApi()
            .latest(userId?:"", parentId?:"", startIndex, limit)
}